package com.pptree.service.impl;

import com.pptree.dao.UserDAO;
import com.pptree.dao.impl.UserDAOImpl;
import com.pptree.service.UserService;
import com.pptree.vo.User;

public class UserServiceImpl implements UserService {
	
	private UserDAO userDAO = new UserDAOImpl();

	@Override
	public User login(String username, String password) {
		User user = userDAO.findUserByUsername(username);
		if(user == null){
			return null;
		}
		else{
			if(user.getPassword().equals(password)){
				return user;
			}
			else{
				return null;
			}
		}
		
	}

}
